<script type="application/ld+json">
  {
    "@context": "http://schema.org",
    "@type": "NewsArticle",
    "mainEntityOfPage": {
      "@type": "WebPage",
      "@id": {{ request.origin | append: page.url | json }}
    },
    "headline": {{ article.title | json }},
    {%- if article.excerpt != blank %}
    "description": {{ article.excerpt | strip_html | json }},
    {%- endif -%}
    {%- if article.image %}
    "image": [
      {{ article | image_url: width: article.image.width | prepend: "https:" | json }}
    ],
    {%- endif %}
    "datePublished": {{ article.published_at | date: '%Y-%m-%dT%H:%M:%SZ' | json }},
    "dateCreated": {{ article.created_at | date: '%Y-%m-%dT%H:%M:%SZ' | json }},
    "author": {
      "@type": "Person",
      "url": {{ request.origin | json }},
      "name": {{ article.author | json }}
    },
    "publisher": {
      "@type": "Organization",
      {%- if settings.share_image %}
      "logo": {
        "@type": "ImageObject",
        "height": {{ settings.share_image.height | json }},
        "url": {{ settings.share_image | image_url: width: settings.share_image.width | prepend: "https:" | json }},
        "width": {{ settings.share_image.width | json }}
      },
      {%- endif %}
      "name": {{ shop.name | json }}
    }
  }
</script>
